package org.jbit.buy.util;


import java.util.List;

import org.jbit.buy.entity.easybuy_news;




public class Page {
   //标识符	1为首页的分页，2为主题的分页
	private int zhonglei;
    // 总页数
    private int totalPageCount = 0;
    
    // 页面大小，即每页显示记录数
    private int pageSize = 5;
    
    
    // 记录总数
    private int totalCount;
    
    
    // 当前页码
    private int currPageNo = 1;
    
    
    // 每页新闻集合
    private List<easybuy_news> newsList;

    public int getCurrPageNo() { 
        if (totalPageCount == 0){
            return 0;
            
        }
        return currPageNo;
    }
    public void setCurrPageNo(int currPageNo) {
        if (currPageNo > 0)
            this.currPageNo = currPageNo;
    }
    public int getPageSize() {
        return pageSize;
    }
    public void setPageSize(int pageSize) {
        if (pageSize > 0){
            this.pageSize = pageSize;
        }else{ 
        this.pageSize=10;
        }
    }
    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        if (totalCount > 0) {
            this.totalCount = totalCount;
            // 计算总页数
            totalPageCount = this.totalCount % pageSize == 0 ? (this.totalCount / pageSize)
                    : (this.totalCount / pageSize + 1);
        }
    }

    public int getTotalPageCount() {
        return totalPageCount;
    }

    public void setTotalPageCount(int totalPageCount) {
        this.totalPageCount = totalPageCount;
    }

    public List<easybuy_news> getNewsList() {
        return newsList;
    }

    public void setNewsList(List<easybuy_news> newsList) {
        this.newsList = newsList;
    }
	public int getZhonglei() {
		return zhonglei;
	}
	public void setZhonglei(int zhonglei) {
		this.zhonglei = zhonglei;
	}
    
}